/*********************\
* Author:Dzlua
* QQ:505544956
* Time:2017/04/16
\**********************/
#include "LuaScrollBar.h"

#define CObjPtr ((CScrollBarUI*)m_cobj)

namespace DuiLib {

int LuaScrollBar::GetOwner(LuaState *L)
{
    CContainerUI* ctrl = CObjPtr->GetOwner();
    LuaHelperNS::PushCObj(L, ctrl);
    return 1;
}

void LuaScrollBar::SetVisible(bool bVisible)
{
    CObjPtr->SetVisible(bVisible);
}

void LuaScrollBar::SetEnabled(bool bEnable)
{
    CObjPtr->SetEnabled(bEnable);
}

void LuaScrollBar::SetFocus()
{
    CObjPtr->SetFocus();
}

bool LuaScrollBar::IsHorizontal()
{
    return CObjPtr->IsHorizontal();
}

void LuaScrollBar::SetHorizontal(bool bHorizontal)
{
    CObjPtr->SetHorizontal(bHorizontal);
}

int LuaScrollBar::GetScrollRange()
{
    return CObjPtr->GetScrollRange();
}

void LuaScrollBar::SetScrollRange(int nRange)
{
    CObjPtr->SetScrollRange(nRange);
}

int LuaScrollBar::GetScrollPos()
{
    return CObjPtr->GetScrollPos();
}

void LuaScrollBar::SetScrollPos(int nPos)
{
    CObjPtr->SetScrollPos(nPos);
}

int LuaScrollBar::GetLineSize()
{
    return CObjPtr->GetLineSize();
}

void LuaScrollBar::SetLineSize(int nSize)
{
    return CObjPtr->SetLineSize(nSize);
}

bool LuaScrollBar::GetShowButton1()
{
    return CObjPtr->GetShowButton1();
}

void LuaScrollBar::SetShowButton1(bool bShow)
{
    CObjPtr->SetShowButton1(bShow);
}

bool LuaScrollBar::GetShowButton2()
{
    return CObjPtr->GetShowButton2();
}

void LuaScrollBar::SetShowButton2(bool bShow)
{
    CObjPtr->SetShowButton2(bShow);
}

int LuaScrollBar::GetButton1NormalImage(LuaState *L)
{
    SDTString str = CObjPtr->GetButton1NormalImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaScrollBar::SetButton1NormalImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetButton1NormalImage(str.c_str());
    return 0;
}

int LuaScrollBar::GetButton1HotImage(LuaState *L)
{
    SDTString str = CObjPtr->GetButton1HotImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaScrollBar::SetButton1HotImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetButton1HotImage(str.c_str());
    return 0;
}

int LuaScrollBar::GetButton1PushedImage(LuaState *L)
{
    SDTString str = CObjPtr->GetButton1PushedImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaScrollBar::SetButton1PushedImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetButton1PushedImage(str.c_str());
    return 0;
}

int LuaScrollBar::GetButton1DisabledImage(LuaState *L)
{
    SDTString str = CObjPtr->GetButton1DisabledImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaScrollBar::SetButton1DisabledImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetButton1DisabledImage(str.c_str());
    return 0;
}

int LuaScrollBar::GetButton2NormalImage(LuaState *L)
{
    SDTString str = CObjPtr->GetButton2NormalImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaScrollBar::SetButton2NormalImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetButton2NormalImage(str.c_str());
    return 0;
}

int LuaScrollBar::GetButton2HotImage(LuaState *L)
{
    SDTString str = CObjPtr->GetButton2HotImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaScrollBar::SetButton2HotImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetButton2HotImage(str.c_str());
    return 0;
}

int LuaScrollBar::GetButton2PushedImage(LuaState *L)
{
    SDTString str = CObjPtr->GetButton2PushedImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaScrollBar::SetButton2PushedImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetButton2PushedImage(str.c_str());
    return 0;
}

int LuaScrollBar::GetButton2DisabledImage(LuaState *L)
{
    SDTString str = CObjPtr->GetButton2DisabledImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaScrollBar::SetButton2DisabledImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetButton2DisabledImage(str.c_str());
    return 0;
}

int LuaScrollBar::GetThumbNormalImage(LuaState *L)
{
    SDTString str = CObjPtr->GetThumbNormalImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaScrollBar::SetThumbNormalImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetThumbNormalImage(str.c_str());
    return 0;
}

int LuaScrollBar::GetThumbHotImage(LuaState *L)
{
    SDTString str = CObjPtr->GetThumbHotImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaScrollBar::SetThumbHotImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetThumbHotImage(str.c_str());
    return 0;
}

int LuaScrollBar::GetThumbPushedImage(LuaState *L)
{
    SDTString str = CObjPtr->GetThumbPushedImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaScrollBar::SetThumbPushedImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetThumbPushedImage(str.c_str());
    return 0;
}

int LuaScrollBar::GetThumbDisabledImage(LuaState *L)
{
    SDTString str = CObjPtr->GetThumbDisabledImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaScrollBar::SetThumbDisabledImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetThumbDisabledImage(str.c_str());
    return 0;
}

int LuaScrollBar::GetRailNormalImage(LuaState *L)
{
    SDTString str = CObjPtr->GetRailNormalImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaScrollBar::SetRailNormalImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetRailNormalImage(str.c_str());
    return 0;
}

int LuaScrollBar::GetRailHotImage(LuaState *L)
{
    SDTString str = CObjPtr->GetRailHotImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaScrollBar::SetRailHotImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetRailHotImage(str.c_str());
    return 0;
}

int LuaScrollBar::GetRailPushedImage(LuaState *L)
{
    SDTString str = CObjPtr->GetRailPushedImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaScrollBar::SetRailPushedImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetRailPushedImage(str.c_str());
    return 0;
}

int LuaScrollBar::GetRailDisabledImage(LuaState *L)
{
    SDTString str = CObjPtr->GetRailDisabledImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaScrollBar::SetRailDisabledImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetRailDisabledImage(str.c_str());
    return 0;
}

int LuaScrollBar::GetBkNormalImage(LuaState *L)
{
    SDTString str = CObjPtr->GetBkNormalImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaScrollBar::SetBkNormalImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetBkNormalImage(str.c_str());
    return 0;
}

int LuaScrollBar::GetBkHotImage(LuaState *L)
{
    SDTString str = CObjPtr->GetBkHotImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaScrollBar::SetBkHotImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetBkHotImage(str.c_str());
    return 0;
}

int LuaScrollBar::GetBkPushedImage(LuaState *L)
{
    SDTString str = CObjPtr->GetBkPushedImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaScrollBar::SetBkPushedImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetBkPushedImage(str.c_str());
    return 0;
}

int LuaScrollBar::GetBkDisabledImage(LuaState *L)
{
    SDTString str = CObjPtr->GetBkDisabledImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaScrollBar::SetBkDisabledImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetBkDisabledImage(str.c_str());
    return 0;
}

int LuaScrollBar::SetPos(LuaState *L)
{
    LuaStack args(L);
    RECT rc = LuaHelperNS::GetRect(args[2]);
    bool bNeedInvalidate = LuaHelperNS::GetBool(args[3], true);
    CObjPtr->SetPos(rc, bNeedInvalidate);
    return 0;
}

SDLUA_BEGIN_REGISTER(LuaScrollBar, ScrollBar, Control)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, GetOwner, GetOwner)
    SDLUA_REGISTER_FUN_CPP(LuaScrollBar, SetVisible, SetVisible)
    SDLUA_REGISTER_FUN_CPP(LuaScrollBar, SetEnabled, SetEnabled)
    SDLUA_REGISTER_FUN_CPP(LuaScrollBar, SetFocus, SetFocus)

    SDLUA_REGISTER_FUN_CPP(LuaScrollBar, IsHorizontal, IsHorizontal)
    SDLUA_REGISTER_FUN_CPP(LuaScrollBar, SetHorizontal, SetHorizontal)
    SDLUA_REGISTER_FUN_CPP(LuaScrollBar, GetScrollRange, GetScrollRange)
    SDLUA_REGISTER_FUN_CPP(LuaScrollBar, SetScrollRange, SetScrollRange)
    SDLUA_REGISTER_FUN_CPP(LuaScrollBar, GetScrollPos, GetScrollPos)
    SDLUA_REGISTER_FUN_CPP(LuaScrollBar, SetScrollPos, SetScrollPos)
    SDLUA_REGISTER_FUN_CPP(LuaScrollBar, GetLineSize, GetLineSize)
    SDLUA_REGISTER_FUN_CPP(LuaScrollBar, SetLineSize, SetLineSize)

    SDLUA_REGISTER_FUN_CPP(LuaScrollBar, GetShowButton1, GetShowButton1)
    SDLUA_REGISTER_FUN_CPP(LuaScrollBar, SetShowButton1, SetShowButton1)
    SDLUA_REGISTER_FUN_CPP(LuaScrollBar, GetShowButton2, GetShowButton2)
    SDLUA_REGISTER_FUN_CPP(LuaScrollBar, SetShowButton2, SetShowButton2)

    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, GetButton1NormalImage, GetButton1NormalImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, SetButton1NormalImage, SetButton1NormalImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, GetButton1HotImage, GetButton1HotImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, SetButton1HotImage, SetButton1HotImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, GetButton1PushedImage, GetButton1PushedImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, SetButton1PushedImage, SetButton1PushedImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, GetButton1DisabledImage, GetButton1DisabledImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, SetButton1DisabledImage, SetButton1DisabledImage)

    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, GetButton2NormalImage, GetButton2NormalImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, SetButton2NormalImage, SetButton2NormalImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, GetButton2HotImage, GetButton2HotImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, SetButton2HotImage, SetButton2HotImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, GetButton2PushedImage, GetButton2PushedImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, SetButton2PushedImage, SetButton2PushedImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, GetButton2DisabledImage, GetButton2DisabledImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, SetButton2DisabledImage, SetButton2DisabledImage)

    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, GetThumbNormalImage, GetThumbNormalImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, SetThumbNormalImage, SetThumbNormalImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, GetThumbHotImage, GetThumbHotImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, SetThumbHotImage, SetThumbHotImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, GetThumbPushedImage, GetThumbPushedImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, SetThumbPushedImage, SetThumbPushedImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, GetThumbDisabledImage, GetThumbDisabledImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, SetThumbDisabledImage, SetThumbDisabledImage)

    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, GetRailNormalImage, GetRailNormalImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, SetRailNormalImage, SetRailNormalImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, GetRailHotImage, GetRailHotImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, SetRailHotImage, SetRailHotImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, GetRailPushedImage, GetRailPushedImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, SetRailPushedImage, SetRailPushedImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, GetRailDisabledImage, GetRailDisabledImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, SetRailDisabledImage, SetRailDisabledImage)

    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, GetBkNormalImage, GetBkNormalImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, SetBkNormalImage, SetBkNormalImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, GetBkHotImage, GetBkHotImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, SetBkHotImage, SetBkHotImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, GetBkPushedImage, GetBkPushedImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, SetBkPushedImage, SetBkPushedImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, GetBkDisabledImage, GetBkDisabledImage)
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, SetBkDisabledImage, SetBkDisabledImage)
    
    SDLUA_REGISTER_FUN_LUA(LuaScrollBar, SetPos, SetPos)

SDLUA_END_REGISTER

SDLUA_BEGIN_UNREGISTER(LuaScrollBar, ScrollBar)
SDLUA_END_UNREGISTER(ScrollBar)

}

#undef CObjPtr